package com.hst.capacity.domain.model.entity.driver;


import com.fasterxml.jackson.annotation.JsonBackReference;
import com.hst.capacity.domain.model.entity.AbstractEntity;
import com.hst.capacity.domain.model.entity.vehicle.VehicleEntity;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * 司机信息表
 */
@Data
@Entity
@Table(name = "dm_driver")
public class DriverEntity extends AbstractEntity {

    @Id
//    @GeneratedValue(generator = "gen_uuid") 取消自动生成 当ID作为索引时,对更新数据表有影响，会自动覆盖设置的值
//    @GenericGenerator(name = "gen_uuid", strategy = "uuid")
    private String idDriver;

    private String idFranchisee;

//    //司机类型（0：真实司机 1：虚拟司机）
//    private int driverType;

    private String driverCode;

    private String idVehicle;

    private String idDriverProfile;

    private String driverIntercityNum;

    private String driverMobile;

    private String password;

    private String regionCode;

    private String icon;

    private String bindDeviceSn;

    private String introducer;

    private Integer createOrderRole;

    private Integer isAgreement;

    private String remark;

    private Integer status;

    private Integer operationStatus;

    private String gpsPn;

    private LocalDateTime registerDate;

    private String registerFrom;

    private Integer loginFailureTimes;

    private LocalDateTime lastLoginTime;

    private Integer tranFlag;

    private String idAgent;//新增代理

    private String idFleet;//新增车队

    private String idCertificate;

    //推送设备ID
    private String idJpush;

    //验证
    private int faceVerify;

//    @OneToOne(cascade = CascadeType.PERSIST)
////    @JoinColumn(name = "id_driver_profile" , referencedColumnName="idDriverProfile")
//    @JoinColumn(name = "id_driver_profile")
//    private DriverProfileEntity driverProfile;

//    @OneToOne
//    @JoinColumn(name = "id_vehicle")
//    private VehicleEntity vehicleEntity;

//    @OneToOne
//    @JoinColumn(name = "id_certificate")
//    private DriverCertificateEntity certificateEntity;

//    @JsonBackReference
//    public void setVehicleEntity(VehicleEntity vehicleEntity) {
//        this.vehicleEntity = vehicleEntity;
//    }
}
